/*
 * Group 3, User Interface Programming II (vt11)
 * Pooya | Flora | Monica | Can
 */
package vical.view;

import java.awt.BorderLayout;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.border.Border;
import com.toedter.calendar.*;
/**
 * Mini-calendar for easy navigation.
 * 
 * @Authour: Monica Kumar
 */
public class MiniCal extends JPanel{

    private JCalendar jcal;
    private ViewPanel viewPanel;
    private Border blackline;
  

    public MiniCal(ViewPanel viewPanel) {
        this.viewPanel = viewPanel;
        initComponents();
    }

    private MiniCal() {
    }

    private void initComponents() {
    
        blackline = BorderFactory.createLineBorder(Color.LIGHT_GRAY);
        jcal = new JCalendar();
        jcal.setWeekOfYearVisible(false);
        jcal.setPreferredSize(new Dimension(200, 180));
        
        jcal.getDayChooser().addPropertyChangeListener("day", new MiniCalDateListener(viewPanel,jcal));
        jcal.getDayChooser().setAlwaysFireDayProperty(true);
        jcal.setBorder(blackline);

        this.setLayout(new BorderLayout());
        this.add(BorderLayout.CENTER, jcal);
        this.setBackground(new Color(140, 140, 140));
    }

     
 }
